﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.master" AutoEventWireup="true" CodeFile="Agenda.aspx.cs" Inherits="Agenda" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
    <form id="empleado" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>

        <ul class="tabs">
            <li><a href="#tab1">Registro</a></li>
            <li><a href="#tab2">Calendario</a></li>
        </ul>

     <div class="tab_container">
         <div id="tab1" class="tab_content">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
            <table>

                <tr class="td1">
                    <td align="right"><label for="curl">Busca citas por usuario:</label></td>
                    <td align="left" >
                        <asp:DropDownList ID="ddUsuarioBusqueda" runat="server">
                        </asp:DropDownList>
                    </td>  
                    <td>
                            <asp:Button ID="btnBuscarAgenda" runat="server" Text="Buscar" 
                                onclick="btnBuscarAgenda_Click" />
                    </td>
                </tr>
                <tr>
                    <td>

                    <asp:GridView ID="grdDatos" runat="server"
                            Width="100%" AllowPaging="True" AllowSorting="True" 
                            DataKeyNames="AgendasId" AutoGenerateColumns="False"
                            GridLines="None" 
                            onselectedindexchanged="grdDatos_SelectedIndexChanged1" CellPadding="4" 
                            ForeColor="#333333" PageSize="25" 
                            onpageindexchanging="grdDatos_PageIndexChanging">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                      <Columns>   
                            <asp:CommandField  ShowEditButton="false"  ShowDeleteButton="false"   
                                ShowSelectButton="true" SelectText="Ver">
                            <ControlStyle Width="25px" Font-Italic="True" />
                            </asp:CommandField>
                            <asp:BoundField 
                             DataField="AgendasId" 
                             HeaderText=" No. "
                             SortExpression="AgendasId" 
                              ControlStyle-Width="10px" >
                            <ControlStyle Width="15px" />
                            <HeaderStyle Font-Size="XX-Small" HorizontalAlign="Center" 
                                VerticalAlign="Middle" Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField 
                             DataField="UsuarioAsignado" 
                             HeaderText="Asignado"
                             SortExpression="UsuarioAsignado" 
                             ControlStyle-Width="30px" >
                            <ControlStyle Width="40px" />
                            <HeaderStyle Font-Size="XX-Small" HorizontalAlign="Center" 
                                VerticalAlign="Middle" Wrap="False" />
                            <ItemStyle Width="70px" />
                            </asp:BoundField>
                            <asp:BoundField 
                             DataField="UsuarioHizo" 
                             HeaderText="Hizo Cita"
                             SortExpression="UsuarioHizo" 
                             ControlStyle-Width="30px" >
                            <ControlStyle Width="40px" />
                            <HeaderStyle Font-Size="XX-Small" HorizontalAlign="Center" 
                                VerticalAlign="Middle" Wrap="False" />
                            <ItemStyle Width="70px" />
                            </asp:BoundField>
                            <asp:BoundField 
                             DataField="Prospecto" 
                             HeaderText="Prospecto"
                             SortExpression="Prospecto" 
                             ControlStyle-Width="30px" >
                            <ControlStyle Width="40px" />
                            <HeaderStyle Font-Size="XX-Small" HorizontalAlign="Center" 
                                VerticalAlign="Middle" Wrap="False" />
                            <ItemStyle Width="100px" />
                            </asp:BoundField>
                            <asp:BoundField 
                             DataField="Asunto" 
                             HeaderText="Asunto"
                             SortExpression="Asunto" 
                             ControlStyle-Width="30px" >
                            <ControlStyle Width="50px" />
                            <HeaderStyle Font-Size="XX-Small" HorizontalAlign="Center" 
                                VerticalAlign="Middle" Wrap="False" />
                            <ItemStyle Width="300px" />
                            </asp:BoundField>
                            <asp:BoundField 
                             DataField="Fecha" 
                             HeaderText="Fecha"
                             SortExpression="Fecha" 
                             ControlStyle-Width="30px"
                             DataFormatString="{0:M-dd-yyyy}" >
                            <ControlStyle Width="40px" />
                            <HeaderStyle Font-Size="XX-Small" HorizontalAlign="Center" 
                                VerticalAlign="Middle" Wrap="False" />
                            <ItemStyle Width="70px" />
                            </asp:BoundField>
                            <asp:BoundField 
                             DataField="Horas" 
                             HeaderText="Hora"
                             SortExpression="Horas"                              
                             ControlStyle-Width="30px"
                              >
                            <ControlStyle Width="40px" />
                            <HeaderStyle Font-Size="XX-Small" HorizontalAlign="Center" 
                                VerticalAlign="Middle" Wrap="False" />
                            <ItemStyle Width="70px" />
                            </asp:BoundField>
                            <asp:BoundField 
                             DataField="Dia" 
                             HeaderText="Dia"
                             SortExpression="Dia" 
                             ControlStyle-Width="30px" >
                            <ControlStyle Width="40px" />
                            <HeaderStyle Font-Size="XX-Small" HorizontalAlign="Center" 
                                VerticalAlign="Middle" Wrap="False" />
                            <ItemStyle Width="70px" />
                            </asp:BoundField>                            
                              <asp:TemplateField HeaderText="Mapa">
                                 <ItemTemplate>  
                              <table width="100%" cellspacing="0" cellpadding="1" border="0">
                              <tr>
                                <%--<td align="left"><a style="color:#595959;" href='<%# "Agenda.aspx?CategoryId=" + DataBinder.Eval(Container.DataItem, "Mapa")%>'><b><nobr><%#  DataBinder.Eval (Container.DataItem, "Mapa") %></nobr></a></b></td>--%>
                                <td align="left"><a style="color:#595959;" href='<%# DataBinder.Eval(Container.DataItem, "Mapa")%>'><b><nobr>Ver</nobr></a></b></td>
                              </tr>
                              </table>                                                                   
                                 </ItemTemplate>
                              </asp:TemplateField>
                       </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#E9E7E2" />
                        <SortedAscendingHeaderStyle BackColor="#506C8C" />
                        <SortedDescendingCellStyle BackColor="#FFFDF8" />
                        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                    </asp:GridView>
                      
                    </td>
                </tr>
                <tr>                    
                    <td> 
                        <asp:LinkButton ID="lnkNuevoCita" runat="server" onclick="lnkNuevoCita_Click" 
                            >Hacer Cita</asp:LinkButton>  | 
                        <asp:LinkButton ID="lnkEliminarCita" runat="server" onclick="lnkEliminarCita_Click" 
                            >Cancelar Cita</asp:LinkButton>   | 
                        <asp:LinkButton ID="lnkEditarCita" runat="server" onclick="lnkEditarCita_Click" 
                            >Re-Agendar</asp:LinkButton></td>

                </tr>
                <tr>
                    <td>

                          <table width="100%" style="width: 600px">

                            <tr class="td2">
                              <td align="right"><label for="corg">Usuario Asignado:</label></td>
                              <td colspan="3" align="left">
                                  <asp:DropDownList ID="ddUsuarioAsignado" runat="server">
                                  </asp:DropDownList>
                                </td>
                            </tr>
                            <tr class="td1">
                              <td align="right"><label for="corg">Quien hizo la cita:</label></td>
                              <td align="left">
                                  <asp:DropDownList ID="ddUsuarioQuien" runat="server">
                                  </asp:DropDownList>
                                </td>
                              <td align="right">Prospecto:</td>
                              <td align="left">
                                  <asp:DropDownList ID="ddProspecto" runat="server">
                                  </asp:DropDownList>
                                </td>
                            </tr>
<%--                            <tr class="td2">
                              <td align="right">Prospecto2:</td>
                              <td align="left">
                                  <asp:DropDownList ID="DropDownList1" runat="server">
                                  </asp:DropDownList>
                                </td>

                            </tr>--%>
                            <tr class="td2">
                              <td align="right"><label for="corg">Asunto:</label></td>
                              <td align="left" >
                                  <asp:TextBox ID="txtAsunto" runat="server" ReadOnly="True" Width = "100px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr class="td1">
                              <td align="right"><label for="corg" ReadOnly="True">Fecha:</label></td>
                              <td align="left">
                            <asp:TextBox ID="fecha" runat="server" onkeypress="return handleEnter(this, event)"></asp:TextBox>
                            <asp:CalendarExtender ID="FechaContratacionExtender"
                            runat="server" TargetControlID = "fecha" Format="yyyy-MM-dd"  
                            CssClass="cal_Theme1"> </asp:CalendarExtender>
                                </td>
                            </tr>
                            <tr class="td2">
                              <td align="right"><label for="curl">Hora:</label></td>
                              <td colspan="1" align="left">
                                  <asp:TextBox ID="txtHora" runat="server" ReadOnly="True"></asp:TextBox> :                                  
                                  <asp:TextBox ID="txtMinutos" runat="server" ReadOnly="True"></asp:TextBox>
                                </td>
                            </tr>
                            <tr class="td1">
                                <td align="right"><label for="curl">Comentarios:</label></td>
                                  <td colspan="3" align="left">
                                  <asp:TextBox ID="txtComentarios" runat="server" ReadOnly="True"></asp:TextBox>
                                </td>
                            </tr>
                            <tr class="td2">
                              <td align="right"><label for="curl">Mapa Google:</label></td>
                              <td align="left" >
                                  <asp:TextBox ID="txtMapa" runat="server" ReadOnly="True"></asp:TextBox>
                                </td>
                            </tr>

                            <tr>
                                <td>
                                    <asp:LinkButton ID="lnkGuardarAgenda" runat="server" onclick="lnkGuardarAgenda_Click"
                                        >Guardar</asp:LinkButton>
                                </td>
                            </tr>
                          </table>

                    </td>
                </tr>
            </table>
            </ContentTemplate>
            </asp:UpdatePanel>  
         </div>
     </div>

    </form>
</asp:Content>

